/**
 * Created by liu on 2018/3/27.
 */

import axios from '../../../api/api';
import { post } from '../../../api/myAxios';
import { getListData } from  '../../../utils/page';
export const getBookComments = (_this) => {
    getListData(bookBookComments, _this);
};

export const bookBookComments = params => {
    return axios.get(`/api/book-comment/list`, params)
        .then(bookComment => {
            return bookComment.data
        })
};

export const create = params => {
    let param = {
        url:'/api/book-comment/add',
        data: {
            id: params.id,
            bookInfoId: params.bookInfoId,
            readerId: params.readerId,
            content:params.bookContent
        }
    };
    return post(param).then(data => data)
};

export const remove = params => {
    let param = {
        url:'/api/book-comment/delete',
        data: {id:params}
    };
    return post(param)
};